package com.Lixiaoqian.PartyHistoryMuseum.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.Lixiaoqian.PartyHistoryMuseum.R;
import com.Lixiaoqian.PartyHistoryMuseum.base.BaseActivity;

public class WebActivity extends BaseActivity {
    private static String INTENT_URL = "url";
  /*  @BindView(R.id.webview)
    WebView webview;*/

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected int setLayout() {
        return R.layout.activity_web;
    }

    @Override
    public void initObject() {
        super.initObject();
        final String url = getIntent().getStringExtra(INTENT_URL);
       /* webview.getSettings().setJavaScriptEnabled(true);
        webview.loadUrl(url);
        webview.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
                webview.loadUrl(url);
                return true;
            }
        });*/

    }

    @Override
    protected void onResume() {
        super.onResume();
       // webview.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
       // webview.onPause();
    }

    @Override
    protected void onStop() {
        super.onStop();
       // webview.stopLoading();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
      //  webview.destroy();
    }

    @Override
    protected void initData() {

    }

    public static void launch(Activity fromactivity, String url) {
        Intent intent = new Intent(fromactivity, WebActivity.class);
        intent.putExtra(INTENT_URL, url);
        fromactivity.startActivity(intent);
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
       /* boolean b = webview.canGoBack();
        if (b) {
            webview.goBack();
        } else {
            super.onBackPressed();
        }*/
    }
}
